home *** CD-ROM | disk | FTP | other *** search
/ BMUG PD-ROM A / PD-ROM A.iso / Games / Strategy / TextMangler 1.2 / TextMangler 1.2.rsrc / TEXT_201.txt < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.0 KB  |  10 lines

  1. The Algorithms
  2.  
  3. TextMangler's Markov table contains an entry for each pair of words in a text, and each of these entries holds the probability of a particular third word following that pair.
  4.  
  5. The Markov chain is built by starting with a pair of words contained in the text (usually the first two words) and generating a pseudorandom number in the range 1 to 100. The probabilities of the third words are then examined and the appropriate third word is selected. For example, if there are two possible third words and the number picked is 52, then the second word would be selected since 52 is in the second half of the range. 
  6.  
  7. This process continues until the words that were the last pair of words in the original text is encountered. 
  8.  
  9. But if that pair also occurs elsewhere in the text, TextMangler calculates the probability that the text has ended and acts appropriately. This may result in output text that is rather long, so you can choose the 'End Early' option to force TextMangler to end the first time the ending pair of words is found.
  10.